Field of the Invention
The present invention relates to an image processing apparatus, a method of controlling the same, and a storage medium.
Description of the Related Art
Conventionally, several techniques for smoothing, in an image forming apparatus, jaggies that occur in an edge portion of text or the like have been proposed. There are various reasons for such jaggies to occur, and it is considered that there are broadly jaggies due to printing by a low-resolution printer, and jaggies caused by halftone processing such as a screening process. One method for halftone processing in image processing is a dither matrix method. This dither matrix method is a method for reproducing a halftone by, with respect to each pixel of image data having a tone, allocating a value indicating black or white based on a certain rule in accordance with a tone value (a pixel value) of the pixel.
As a technique for smoothing jaggies due to the former low-resolution printer, for example, there is something that performs edge detection by pattern matching with respect to a binary image and for a matching portion removes a pixel or adds a pixel corresponding to a pattern (for example, refer to Japanese Patent Laid-Open No. H10-42141). This detects a portion in which jaggies occur, sets the pixel data of the portion to be data that divides one pixel into a plurality of pixels in the case of a binary printer, and performs smoothing of the edge portion by the plurality of pixels. In the case of a multi-value printer, dots of an intermediate level are added to pixels of an edge portion to realize smoothing processing of the edge portion.
In addition, as a technique for smoothing jaggies due to the latter halftone processing, for example, there is one that generates correction data from image data before halftone processing and adds the correction data to an edge portion of the image data after the halftone processing so as to outline (for example, refer to Japanese Patent Laid-Open No. 2006-295877). This is something for smoothing jaggies due to the screening process by, with respect to an edge portion to which smoothing processing should be performed, comparing the correction data and the image data after halftone processing, and outputting data having the larger value.
However, in the foregoing method, while it is possible to ameliorate jaggies due to the screening process, if the background of the edge portion (outside of the edge) is not white, there is a possibility that the screening process and correction processing of the edge interfere, and lead to deterioration of the image. Specifically, if the background of the edge portion is white, correction data is added to the edge portion, and because the correction data only receives influence from a screening process of an inside the edge portion, an amelioration effect of the jaggies is higher than deterioration of the image. However, if the background of the edge portion is not white, because the added correction data also receives influence from a screening process of the background of the edge portion and not just influence from a screening process of the inside of the edge portion, pixel values corresponding to a unit area of the edge portion become larger than those in the vicinity of the edge portion. Thus, this leads to an increase of a density of the edge portion in comparison to the vicinity, and deterioration of the image.